home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / util / wb / ExtraInfo.lha / ExtraInfo / ExtraInfo.install < prev    next >
Text File  |  1995-05-21  |  10KB  |  414 lines

  1. ; *************************************************************************
  2. ; ********************  EXTRAINFO INSTALLATION SCRIPT  ********************
  3. ; *************************************************************************
  4. ;
  5. ; $VER: ExtraInfo.install 1.0 (9.5.95)
  6. ;
  7. ; Copyright ©1995 Nick Christie
  8. ;
  9. ; *************************************************************************
  10. ;
  11. ; Find out about program version, etc
  12.  
  13. ; get version of EI in distribution
  14. (set vernum-ei (getversion "ExtraInfo"))
  15. (set ver-ei    (/ vernum-ei 65536))
  16. (set rev-ei    (- vernum-ei (* ver-ei 65536) ) )
  17.  
  18. (set @default-dest "")
  19. (set defeidir "SYS:WBStartup")
  20. (set catsdir "Locale:Catalogs")
  21. (set libsdir "Libs:")
  22.  
  23. ; if novice user-level, bump up to average
  24. (if (= 0 @user-level)
  25.     (
  26.     (set @user-level 1)
  27.     (user 1)
  28.     )
  29. )
  30.  
  31. (set old-user-level @user-level)
  32.  
  33. ; ************************************************************************
  34. ; English strings
  35. ; ************************************************************************
  36.  
  37. (set default_lang 2)
  38.  
  39. (set #yes-msg "Yes")
  40.  
  41. (set #no-msg "No")
  42.  
  43. (set #bad-kick-msg "ExtraInfo requires AmigaOS 2.04 or better!")
  44.  
  45. (set #hello-msg
  46.     (cat
  47.         ("Welcome to ExtraInfo V%ld.%ld\n\n" ver-ei rev-ei)
  48.         "This script will install ExtraInfo and "
  49.         "related files on your Amiga.\n\n"
  50.         "You will need to answer a few questions such as "
  51.         "where you would like the program installed.\n\n"
  52.         "If you do not wish to install ExtraInfo at this time, "
  53.         "select the 'Abort Install' button now. "
  54.     )
  55. )
  56.  
  57. (set #ei-askdir-msg "Please select the directory to install ExtraInfo in.")
  58.  
  59. (set #keepicon-msg "\nDo you wish to keep your existing ExtraInfo icon?")
  60.  
  61. (set #keepicon-help
  62.     (cat
  63.         "If you select 'Yes', your existing ExtraInfo icon will not "
  64.         "be overwritten. If you select 'No', a new icon for ExtraInfo "
  65.         "will be installed."
  66.     )
  67. )
  68.  
  69. (set #bgui-askdir-msg
  70.     (cat
  71.         "Select the directory to install bgui.library in. "
  72.         "(Will *not* overwrite any existing newer version.)"
  73.     )
  74. )
  75.  
  76. (set #eiai-ask-msg "\nDo you wish to install the standard AppIcon?")
  77.  
  78. (set #eiai-ask-help
  79.     (cat
  80.         "If you select 'Yes' the standard AppIcon will be installed "
  81.         "in a directory of your choice. Select 'No' if you do not wish "
  82.         "to use the AppIcon facility, or if you will be providing your "
  83.         "own AppIcon image."
  84.     )
  85. )
  86.  
  87. (set #eiai-askdir-msg "Please select the directory to install the AppIcon in.")
  88.  
  89. (set #eiguide "ExtraInfo.guide")
  90.  
  91. (set #eiguide-ask-msg
  92.     (cat
  93.         "\nInstall ExtraInfo documentation?\n\n"
  94.         "(This is an AmigaGuide file, and you will be asked "
  95.         "for the directory in which to install it.)\n\n"
  96.         "I recommend installing this, and reading it too, "
  97.         "so that you know how to utilitise ExtraInfo to "
  98.         "its fullest. "
  99.     )
  100. )
  101.  
  102. (set #eiguide-askdir-msg
  103.     "Please select the directory to install ExtraInfo.guide in."
  104. )
  105.  
  106. (set #guide-help
  107.     (cat
  108.         "AmigaGuide is the Amiga's standard hypertext format.\n\n"
  109.         "If you have AmigaOS 3.0 or better, you can use MultiView "
  110.         "to read this documentation, otherwise you must use the AmigaGuide "
  111.         "program, which is available on AmiNet and Fred Fish disk #870.\n\n"
  112.         "Both of these viewer programs have a 'search path', a set "
  113.         "of directories they search for AmigaGuide documents. "
  114.         "You should place this guide somewhere in that path."
  115.     )
  116. )
  117.  
  118. (set #locale-msg
  119.     (cat
  120.         "\ExtraInfo is localized, which means you may use "
  121.         "the program in several different languages. "
  122.         "Please choose your preferred languages.\n"
  123.     )
  124. )
  125.  
  126. (set #locale-help
  127.     (cat
  128.         "These are the languages supported by ExtraInfo.\n\n"
  129.         "Simply specify the languages you prefer and the "
  130.         "required catalog files will be copied to the "
  131.         "Locale:Catalogs directory."
  132.     )
  133. )
  134.  
  135. ; ************************************************************************
  136. ; xxxx strings - template for other languages
  137. ; ************************************************************************
  138.  
  139. (if (= @language "xxxx")
  140.     (
  141.     (set default_lang ?)
  142.  
  143.     (set #yes-msg "Yes")
  144.  
  145.     (set #no-msg "No")
  146.  
  147.     (set #bad-kick-msg "ExtraInfo requires AmigaOS 2.04 or better!")
  148.  
  149.     (set #hello-msg
  150.         (cat
  151.             ("Welcome to ExtraInfo V%ld.%ld\n\n" ver-ei rev-ei)
  152.             "This script will install ExtraInfo and "
  153.             "related files on your Amiga.\n\n"
  154.             "You will need to answer a few questions such as "
  155.             "where you would like the program installed.\n\n"
  156.             "If you do not wish to install ExtraInfo at this time, "
  157.             "select the 'Abort Install' button now. "
  158.         )
  159.     )
  160.  
  161.     (set #ei-askdir-msg "Please select the directory to install ExtraInfo in.")
  162.  
  163.     (set #keepicon-msg "\nDo you wish to keep your existing ExtraInfo icon?")
  164.  
  165.     (set #keepicon-help
  166.         (cat
  167.             "If you select 'Yes', your existing ExtraInfo icon will not "
  168.             "be overwritten. If you select 'No', a new icon for ExtraInfo "
  169.             "will be installed."
  170.         )
  171.     )
  172.  
  173.     (set #eiai-ask-msg "\nDo you wish to install the standard AppIcon?")
  174.  
  175.     (set #eiai-ask-help
  176.         (cat
  177.             "If you select 'Yes' the standard AppIcon will be installed "
  178.             "in a directory of your choice. Select 'No' if you do not wish "
  179.             "to use the AppIcon facility, or if you will be providing your "
  180.             "own AppIcon image."
  181.         )
  182.     )
  183.  
  184.     (set #eiai-askdir-msg
  185.         "Please select the directory to install the AppIcon in."
  186.     )
  187.  
  188.     (set #eiguide "ExtraInfo.guide")
  189.  
  190.     (set #eiguide-ask-msg
  191.         (cat
  192.             "\nInstall ExtraInfo documentation?\n\n"
  193.             "(This is an AmigaGuide file, and you will be asked "
  194.             "for the directory in which to install it.)\n\n"
  195.             "I recommend installing this, and reading it too, "
  196.             "so that you know how to utilitise ExtraInfo to "
  197.             "its fullest. "
  198.         )
  199.     )
  200.  
  201.     (set #eiguide-askdir-msg
  202.             "Please select the directory to install ExtraInfo.guide in."
  203.     )
  204.  
  205.     (set #guide-help
  206.         (cat
  207.             "AmigaGuide is the Amiga's standard hypertext format.\n\n"
  208.             "If you have AmigaOS 3.0 or better, you can use MultiView "
  209.             "to read this documentation, otherwise you must use the AmigaGuide "
  210.             "program, which is available on AmiNet and Fred Fish disk #870.\n\n"
  211.             "Both of these viewer programs have a 'search path', a set "
  212.             "of directories they search for AmigaGuide documents. "
  213.             "You should place this guide somewhere in that path."
  214.         )
  215.     )
  216.  
  217.     (set #locale-msg
  218.         (cat
  219.             "\ExtraInfo is localized, which means you may use "
  220.             "the program in several different languages. "
  221.             "Please choose your preferred languages.\n"
  222.         )
  223.     )
  224.  
  225.     (set #locale-help
  226.         (cat
  227.             "These are the languages supported by ExtraInfo.\n\n"
  228.             "Simply specify the languages you prefer and the "
  229.             "required catalog files will be copied to the "
  230.             "Locale:Catalogs directory."
  231.         )
  232.     )
  233.  
  234.     ) ; endif xxxx language
  235. )
  236.  
  237. ; ************************************************************************
  238. ; Begin actual installation
  239. ; ************************************************************************
  240.  
  241. ; Check for KickV37 or better
  242.  
  243. (if (< (/ (getversion) 65536) 37)
  244.     (
  245.     (abort #bad-kick-msg)
  246.     )
  247. )
  248.  
  249. ; ------------------------------------------------------------------------
  250. ; Show welcome msg
  251.  
  252. (user 2)
  253. (message #hello-msg)
  254. (user old-user-level)
  255.  
  256. ; ------------------------------------------------------------------------
  257. ; Ask the user where we should install ExtraInfo.
  258.  
  259. (set eidir
  260.     (askdir
  261.         (prompt #ei-askdir-msg)
  262.         (help @askdir-help)
  263.         (default defeidir)
  264.     )
  265. )
  266.  
  267. ; ------------------------------------------------------------------------
  268. ; If there is an icon for ExtraInfo there already, ask the user if we
  269. ; should keep it. If yes then copy just the program, else copy both
  270. ; the program and icon.
  271.  
  272. (if (exists (tackon eidir "ExtraInfo.info"))
  273.     ; then
  274.     (if (askbool
  275.             (prompt #keepicon-msg)
  276.             (choices #yes-msg #no-msg)
  277.             (help #keepicon-help)
  278.             (default 1)
  279.         )
  280.         ; then
  281.         (copyfiles (source "ExtraInfo") (dest eidir) )
  282.         ; else
  283.         (copyfiles (source "ExtraInfo") (dest eidir) (infos) )
  284.     )
  285.     ; else no info there
  286.     (copyfiles (source "ExtraInfo") (dest eidir) (infos) )
  287. )
  288.  
  289. (set @default-dest eidir)
  290.  
  291. ; ------------------------------------------------------------------------
  292. ; Install BGUI library. If expert, ask for directory.
  293.  
  294. (if (= 2 @user-level)
  295.     (set libsdir
  296.         (askdir
  297.             (prompt #bgui-askdir-msg)
  298.             (help @askdir-help)
  299.             (default libsdir)
  300.         )
  301.     )
  302. )
  303.  
  304. (copylib (source "Libs/bgui.library") (dest libsdir)
  305. )
  306.  
  307. ; ------------------------------------------------------------------------
  308. ; Install ExtraInfo.appicon. Ask yes/no first, then ask for directory.
  309.  
  310. (set aidir eidir)
  311.  
  312. (if (askbool
  313.         (prompt #eiai-ask-msg)
  314.         (help #eiai-ask-help)
  315.         (default 1)
  316.         (choices #yes-msg #no-msg)
  317.     )
  318.     ; then
  319.     (
  320.     (set aidir
  321.         (askdir
  322.             (prompt #eiai-askdir-msg)
  323.             (help @askdir-help)
  324.             (default aidir)
  325.         )
  326.     )
  327.     (copyfiles (source "ExtraInfo.appicon.info") (dest aidir) )
  328.     (tooltype
  329.         (dest (tackon eidir "ExtraInfo"))
  330.         (settooltype "APPICONNAME" (tackon aidir "ExtraInfo.appicon"))
  331.     )
  332.     )
  333. )
  334.  
  335. ; ------------------------------------------------------------------------
  336. ; Install ExtraInfo.guide. Ask yes/no first, then ask for directory.
  337.  
  338. (set guidedir eidir)
  339.  
  340. (if (askbool
  341.         (prompt #eiguide-ask-msg)
  342.         (help #guide-help)
  343.         (default 1)
  344.         (choices #yes-msg #no-msg)
  345.     )
  346.     ; then
  347.     (
  348.     (set guidedir
  349.         (askdir
  350.             (prompt #eiguide-askdir-msg)
  351.             (help @askdir-help)
  352.             (default guidedir)
  353.         )
  354.     )
  355.     (copyfiles (source #eiguide) (dest guidedir) (infos) )
  356.     (tooltype
  357.         (dest (tackon eidir "ExtraInfo"))
  358.         (settooltype "GUIDENAME" (tackon guidedir "ExtraInfo.guide"))
  359.     )
  360.     )
  361. )
  362.  
  363. ; ------------------------------------------------------------------------
  364. ; install catalog(s) - none available yet
  365. ;
  366. ;(if (exists "libs:locale.library")
  367. ;    (
  368. ;    (if (exists catsdir)
  369. ;        (
  370. ;        (user 2)     
  371. ;        (set lang
  372. ;            (askoptions
  373. ;                (prompt #locale-msg)
  374. ;                (help #locale-help)
  375. ;                (choices
  376. ;                    "English"
  377. ;                )
  378. ;                (default default_lang)
  379. ;            )
  380. ;        )
  381. ;        (user old-user-level)
  382. ;        (set n 0)
  383. ;        (while
  384. ;            (set language
  385. ;                (select n
  386. ;                    "english"
  387. ;                    ""
  388. ;                )
  389. ;            )
  390. ;            (
  391. ;                (if (in lang n)
  392. ;                    (
  393. ;                    (if (<> 2 n)
  394. ;                        (
  395. ;                        (makedir (cat catsdir "/" language))
  396. ;                        (copyfiles
  397. ;                            (source (cat "Catalogs/" language))
  398. ;                            (dest (cat catsdir "/" language))
  399. ;                            (all)
  400. ;                        )
  401. ;                        )
  402. ;                    )
  403. ;                    )
  404. ;                )
  405. ;                (set n (+ n 1))
  406. ;            )
  407. ;        ) ; endwhile pick language n
  408. ;        ) ; endthen
  409. ;    ) ; endif exists catsdir
  410. ;    ) ; endthen
  411. ;
  412. ;) ; endif exists locale lib
  413.  
  414.